<div class="form-group">
    <div class="col-sm-4">
        <input  type="button" value="选择文件" id="img" /> <br>
    </div>
</div>
<div class="form-group">
    <div class="col-sm-4">
        <img src="__public__uploads/view.png" style="border:2px solid #dddddd;" id="show_img" width="200px" >
    </div>
</div>

<div style="display:none;">
    <input type="text" id="get_title" >
</div>


<link rel="stylesheet" href="__public__static/cut_img/kindeditor/themes/default/default.css" />
<script charset="utf-8" src="__public__static/cut_img/kindeditor/kindeditor-all-min.js"></script>
<script charset="utf-8" src="__public__static/cut_img/kindeditor/lang/zh_CN.js"></script>

<script>
    //上传原图
    KindEditor.ready(function(K) {
        var editor = K.editor({
                    uploadJson : '{:url('cut_pic/index/qiniu_upload')}',
                fileManagerJson : '',
                allowFileManager : false
    });

        //function(url, title, width, height, border, align)
        //url as title ,size as width
        K('#img').click(function() {
            editor.loadPlugin('image', function() {
                editor.plugin.imageDialog({
                    imageUrl : K('#img').val(),
                    clickFn : function(url,title) {
                        alert(url);
                        alert(title);
//                        document.getElementById('show_img').src = '__public__uploads/pre_pic/'+title;
//                        $("#get_title").val(title);
                        editor.hideDialog();
                    }
                });
            });
        });
    });
</script>